package com.woniu.humanresource.dao;

import com.woniu.humanresource.entity.Achievement;
import com.woniu.humanresource.entity.AchievementBehavior;
import com.woniu.humanresource.entity.AchievementEfficiency;
import com.woniu.humanresource.entity.InsertAchievement;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface AchievementDao {
    // 查询绩效
    List<Achievement> selectAchievement(@Param("pageIndex") int index,@Param("pnum") int pnum,
                                        @Param("dapartid") int dapartid);
    //查询员工总数
    int selectAllEmp(@Param("pnum") int pnum, @Param("dapartid") int dapartid);//

    //查询所有考核内容
    List<AchievementEfficiency> selectAllEfficienciesContext();
    List<AchievementBehavior> selectAllBehaviorContext();

    //插入achievement数据
    void insertAchievement(InsertAchievement insertAchievement);

    //查询efficiencyid
    int selectEfficiencyId(String accontext);
    //查询behaviorid
    int selectBehavioridId(String accontext);

    //插入efficiency数据
    void insertEfficiency(@Param("aeaid")int aeaid,@Param("scores")int scores,@Param("aid")int aid);
    //插入behavior数据
    void insertBehavior(@Param("aeaid")int aeaid,@Param("scores")int scores,@Param("aid")int aid);

    //查询achievement表中有没有id的数据
    int selectId(int id);

    //更新分数
    void updateEfficiency(@Param("aeaid")int aeaid,@Param("scores")int scores,@Param("aid")int aid );
    void updateBehavior(@Param("aeaid")int aeaid,@Param("scores")int scores,@Param("aid")int aid );

}
